<?php
//模块插件类
//插件功能类，由系统调用，实现具体功能。
defined('BY_JYA') or exit('error');
class core_jy_poster extends plugin{
	public function qr_scan($params=array()){
		$params['data']=json_decode($params['data'],true);
		$id=$params['data']['id'];
		if(!$id || !$params['data']['fromuser']){
			return false;
		}
		$this->model('model')->get_fee($id,$params['data']['fromuser']);
		pdo_update('jy_poster_poster',array('follows +='=>1),array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
		$poster=pdo_get('jy_poster_poster',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
		if($poster['fenxiao_level']){
			model('jy_commission/member')->set_parent($_SESSION['uid'],$params['data']['fromuser']);
		}
		if($poster['fenxiao_set']){
			model('jy_commission/member')->checkmember($_SESSION['uid'],'',true);
		}
	}
	public function receive($message){
		if($message['Event']=='subscribe'){
			//这里编写关注事件处理代码
			
		}
		if($message['Event']=='unsubscribe'){
			//这里编写取消关注事件处理代码
			
		}
	}
}
?>